package com.fadis.protocol;

public class SimpleString extends BaseRespProtocol {

    private String str;

    public SimpleString(String str) {
        this.str = str;
    }

    public String getStr() {
        return str;
    }

    @Override
    public String encode() {
        String ss = "+{s}\r\n";
        ss = ss.replace("{s}", str == null ? "" : str);
        return ss;
    }

    public static String encodedSimpleString(String s){
        return CmdEncoder.getDefault().encode(new SimpleString(s));
    }


}
